package me.miencraft.plugin.superlobby.util;

import org.bukkit.event.entity.EntityDamageEvent;

/**
 * @author langle__
 * @version 1.0
 */
public class EntityDamageCause {

    public static final EntityDamageEvent.DamageCause Kill = getEntityDamageCause("kill");

    public static EntityDamageEvent.DamageCause getEntityDamageCause(String cause) {
        String upperCause = cause.toUpperCase();
        for (EntityDamageEvent.DamageCause value : EntityDamageEvent.DamageCause.values()) {
            if (value.name().equalsIgnoreCase(upperCause)) {
                return value;
            }
        }
        return null;
    }

}
